//
//  AudioPlayer.h
//  LO_MUSIC
//
//  Created by lanou3g on 16/2/26.
//  Copyright © 2016年 徐强. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@protocol AudioPlayerDelegate <NSObject>
//播放结束执行的协议
- (void)playFinish;

//每0.1秒执行一次
//time 当前的时间
- (void)playWithTime:(CGFloat )time;

@end




@interface AudioPlayer : NSObject

//1. 文件是单例
+ (instancetype)shareAudioPlayer;
//2. 播放
- (void)playWithUrl:(NSString *)url;
//3. 暂停/恢复
- (void)playOrPause;
//4. 停止
- (void)stop;
//5. 从什么时候开始播放
- (void)seekToTime:(CGFloat)time;
//6. 设置音量
//7. 获取音量
@property (nonatomic,assign) CGFloat volume;
//8. 是否正在播放
@property (nonatomic,assign,readonly,getter=isPlaying) BOOL playing;

@property (nonatomic,weak)id<AudioPlayerDelegate>delegate;

@end
